<template>
    <div class="upgrade main_bg">
        <div class='moduleHead main_bg'>
            <span>{{language.unify_upgrade}}</span>
        </div>
        <div class="body">
            <!--<div class="remiend">
                {{language.upgrade_noteOne}}
            </div>
            <h4> {{language.upgrade_itemTitle}} </h4>-->
            <div class="optionLineBox" @click="updateItem(6)">
                <span class="font1">6 {{language.upgrade_months}}:</span>
                <span class="font3">{{language.upgrade_priceThree}}</span>
                <span class="font4">/ {{language.upgrade_mo}}</span>
                <p>{{language.upgrade_priceNote}} {{language.upgrade_priceThreeTotal}}</p>
            </div>
            <div class="optionLineBox" @click="updateItem(3)">
                <span class="font1">3 {{language.upgrade_months}}:</span>
                <span class="font3">{{language.upgrade_priceTwo}}</span>
                <span class="font4">/ {{language.upgrade_mo}}</span>
                <p>{{language.upgrade_priceNote}} {{language.upgrade_priceTwoTotal}}</p>
            </div>
            <div class="optionLineBox" @click="updateItem(1)">
                <span class="font1">1 {{language.upgrade_month}}:</span>
                <span class="font3">{{language.upgrade_priceOne}}</span>
                <span class="font4">/ {{language.upgrade_mo}}</span>
            </div>
            <div class="upgradeDes ">
                <!--<b>{{language.upgrade_noteTitle}}</b>-->
                <dl class="noteList">
                    <dd v-for="item in this.language.upgrade_noteItems">{{item}}</dd>
                </dl>
                <p>{{language.upgrade_noteMore}}</p>
                <p>{{language.upgrade_noteOne}}</p>
            </div>
        </div>
        <loading :props="{show:ajaxBool,type:'page'}"></loading>
    </div>
</template>
<script>
import * as API from '../api'
import loading from './Loading'

export default {
    name: 'upgrade',

    data: function() {
        return {
            months: 6,
            ajaxBool: false
        }
    },

    components: {
        loading,
    },

    methods: {
        updateItem: function(val) {
            this.months = val;
            this.handlePay();
        },

        handlePay: function() {
            var tthis = this;
            if (tthis.ajaxBool) {
                return false;
            } else {
                tthis.ajaxBool = true;
            }
            API.make_mpaycc_link({
                data: {
                    months: this.months,
                    mobile: 1,
                    original_url: Unit.getSessionStorage('cur_url')
                },
                success: function(response) {
                    Unit.setSessionStorage('paying', 'true');
                    window.location.href = response.uri; //go to paypal
                },
                complete: function() {
                    tthis.ajaxBool = false;
                }
            });
        },
    },
}

</script>
<style scoped>
.upgrade {
    padding-top: 54px;
}

.upgrade .remiend {
    font-size: 13.5px;
    text-align: center;
    line-height: 18px;
    padding: 18px 20px 10px 20px;
}

.upgrade h4 {
    font-size: 15px;
    text-align: center;
    padding-top: 13px;
    font-weight: bold;
}

.upgrade .optionLineBox {
    margin: 0 17.5px 15px 17.5px;
    position: relative;
    box-shadow: 0 4px 4px rgba(75, 75, 75, .1);
    border-radius: 5px;
    border-width: 1px;
    border-style: solid;
    border-color: rgba(255,255,255,.6);
    padding: 6px 10px;
    text-align: center;
    min-height: 70px;
    line-height: 26px;
    color: rgba(255,255,255,.6);
}

.upgrade .optionLineBox .pA {
    border-radius: 3px;
    padding: 15px 0;
    text-align: center;
}

.upgrade .optionLineBox .pA.main_bg p {
    color: #fff;
}

.upgrade .optionLineBox p {
    font-size: 12px;
    line-height: 20px;
}

.upgrade .optionLineBox .font1 {
    font-size: 17px;
    display: block;
    text-align: left;
    line-height: 20px;
}

.upgrade .optionLineBox .font3 {
    font-size: 22px;
    color: #fff;
}

.upgrade .optionLineBox .font4 {
    font-size: 12px;
    text-transform: lowercase;
    color: #fff;
}


.upgrade .upgradeDes {
    margin: auto 17.5px;
}

.upgrade .upgradeDes .noteList dd{
    line-height: 34px;
    min-height: 34px;
    font-size: 15px;
    background-size: 25px auto;
    background-repeat: no-repeat;
    background-image: url(../assets/ico_note_upgrade.png);
    padding-left: 37px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
    color: rgba(255,255,255,.75);
}

.upgrade .upgradeDes .noteList dd:nth-child(1){
    background-position: 0 8px;
}

.upgrade .upgradeDes .noteList dd:nth-child(2){
    background-position: 0 -29px;
}

.upgrade .upgradeDes .noteList dd:nth-child(3){
    background-position: 0 -64px;
}

.upgrade .upgradeDes .noteList dd:nth-child(4){
    background-position: 0 -101px;
}

.upgrade .upgradeDes .noteList dd:nth-child(5){
    background-position: 0 -139px;
}

.upgrade .upgradeDes p {
    padding: 8px 0;
    font-size: 12px;
    text-align: center;
    color: rgba(255,255,255,.8);
}
.upgrade .upgradeDes p:last-child {
    color: rgb(255,255,255);
}

</style>
